package com.binhai;

import com.binhai.conifg.Config;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.ConfigurableApplicationContext;

@SpringBootApplication
public class SpringDemoApplication {

    @Autowired
    private Config config;
    public static void main(String[] args) {
       System.out.println("启动中...");
       ConfigurableApplicationContext context = SpringApplication.run(SpringDemoApplication.class, args);
       SpringDemoApplication app = context.getBean(SpringDemoApplication.class);

       System.out.println("启动路径:http://localhost:"+app.config.getPort());

       System.out.println("启动成功");

    }

}
